<style>
    #d {
        line-height: 100px;
    }
    
    div {
        border: solid 1px lightskyblue;
    }
</style>

<div id="d">line-height 适合单独一行垂直居中</div>